package com.ysdwl.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysdwl.model.Bill;
import com.ysdwl.model.Provider;
import com.ysdwl.service.impl.BillService;
import com.ysdwl.service.impl.ProviderService;

@WebServlet(urlPatterns = "/toBillAdd")
public class toBillAddServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {

			ProviderService providerService = new ProviderService();
			List<Provider> list = providerService.findAll(null);
			System.out.println(list);
			

			req.setAttribute("proList", list);

			req.getRequestDispatcher("billAdd.jsp").forward(req, resp);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req, resp);
	}
}
